import java.util.LinkedList;

/**
 * @author 
 * Yannic Remmet			196983
 * Tobias Trabelsi			197112
 * Anna-Katharina Wickert	197122
 */
public class ListQueue<T> implements Queue<T> {

	public ListQueue() {
		content = new LinkedList<T>();
	}
	public ListQueue(LinkedList<T> a){
		content = a;
	}
	
	public boolean enter(T o) {
		int sizeBefore = content.size();
		assert sizeBefore > 0 : "A negative size of the content.";
		content.add(o);
		assert sizeBefore + 1 == content.size() : "Mistake while entering an element.";
		if (sizeBefore + 1 == content.size())
			return true;
		return false;
	}


	public void front() {
		System.out.println(content.getFirst().toString());
	}


	public boolean isEmpty() {
		return content.isEmpty();
	}


	public T leave() {
		return content.removeFirst();
	}

	// data elements
	LinkedList<T> content;
}
